package Readers;

import java.util.Arrays;
import java.util.List;

import NWPackage.Calculations;
import NWPackage.ProbabilityCell;
import NWPackage.RealVoteCell;

public class StaticInputs extends Inputs {
	
	private final String[] candidates = {"A","B"};
	private List<String> dynamicCandidates = Arrays.asList(candidates);
	private final int numCandidates = candidates.length;
	
	private final String[] agents = {"V1", "V2"};
	private final int numAgents = agents.length;
	private ProbabilityCell[] allprobabilities=null;
	
	//{X,B} = X<B
	private String[][] preferrences = {{"A","B"},{"B","A"}};
	
	private final int MonteCarloRandomProcess = 2;
	
	private final int huristic = 1;
	//private final int BORDA_MIN_VALUE = 1;
	//private final int BORDA_MAX_VALUE = numCandidates;
	//private final int RANDOM_SEED = 19830912;
	
	
	

	public  void matrixProbabilities() {
		allprobabilities = new ProbabilityCell[numAgents*Calculations.calcCandidatesPermutationsNPR(numCandidates)];
		
		//get probabilities:
		//in '<' order ( by the index) 
		
		allprobabilities[0] = new ProbabilityCell("V1", 0.3,Arrays.asList(preferrences[0]));
		allprobabilities[1] = new ProbabilityCell("V1", 0.7,Arrays.asList(preferrences[1]));
		allprobabilities[2] = new ProbabilityCell("V2", 0.4,Arrays.asList(preferrences[0]));
		allprobabilities[3] = new ProbabilityCell("V2", 0.6,Arrays.asList(preferrences[1]));
	}

	public RealVoteCell[] realVotesMatrix() {

		RealVoteCell[] allRealVotes = new RealVoteCell[numAgents];
		
		allRealVotes[0] = new RealVoteCell("V1",0,Arrays.asList(preferrences[1]));
		allRealVotes[1] = new RealVoteCell("V2",1,Arrays.asList(preferrences[1]));
		//allRealVotes[2] = new RealVoteCell("V3",2,Arrays.asList(preferrences[5]));
		//allRealVotes[3] = new RealVoteCell("V4",3,Arrays.asList(preferrences[2]));
		return allRealVotes;
	}
	public String[] getCandidates() {
		return this.candidates;
	}

	public List<String> getDynamicCandidates() {
		return this.dynamicCandidates;
	}

	public int getNumCandidates() {
		return this.numCandidates;
	}

	public String[] getAgents() {
		return this.agents;
	}

	public int getNumAgents() {
		return this.numAgents;
	}

	public int getMonteCarloRandomProcess() {
		return this.MonteCarloRandomProcess;
	}

	public int getBordaMaxValue() {
		return this.BORDA_MAX_VALUE;
	}

	public int getBordaMinValue() {
		return this.BORDA_MIN_VALUE;
	}

	@Override
	public ProbabilityCell[] getMatrixProbabilities() {
		if (this.allprobabilities == null)
			matrixProbabilities();
		return allprobabilities;
	}

	@Override
	public String getFileName() {
		return "StaticInputs";
	}

	@Override
	public int getHuristic() {
		return huristic;
	}


}
